import Cookies from 'js-cookie'

const TokenKey = process.env['VUE_APP_BASE_PREFIX'] + 'UserToken'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}
export function getUrl() {
  return Cookies.get('HrefUrl')
}

export function setUrl(url) {
  return Cookies.set('HrefUrl', url)
}
export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function setUserInfo(userInfo) {
  return Cookies.set((process.env['VUE_APP_BASE_PREFIX'] + 'UserInfo'), userInfo)
}

export function getUserInfo() {
  return Cookies.get((process.env['VUE_APP_BASE_PREFIX'] + 'UserInfo'))
}

export function removeUserInfo() {
  return Cookies.remove((process.env['VUE_APP_BASE_PREFIX'] + 'UserInfo'))
}

export function setUserId(userInfo) {
  return Cookies.set((process.env['VUE_APP_BASE_PREFIX'] + 'UserId'), userInfo)
}

export function getUserId() {
  return Cookies.get((process.env['VUE_APP_BASE_PREFIX'] + 'UserId'))
}

export function removeUserId() {
  return Cookies.remove((process.env['VUE_APP_BASE_PREFIX'] + 'UserId'))
}

export function setFtpCk(ftpCkUrl) {
  return Cookies.set((process.env['VUE_APP_BASE_PREFIX'] + 'FtpCkUrl'), ftpCkUrl)
}
export function getFtpCk() {
  return Cookies.get((process.env['VUE_APP_BASE_PREFIX'] + 'FtpCkUrl'))
}
export function setFtpCs(ftpCsUrl) {
  return Cookies.set((process.env['VUE_APP_BASE_PREFIX'] + 'FtpCsUrl'), ftpCsUrl)
}
export function getFtpCs() {
  return Cookies.get((process.env['VUE_APP_BASE_PREFIX'] + 'FtpCsUrl'))
}
